The present invention relates to a method of resolution conversion of digital data and in particular digital image and video data. The invention also relates to a computer program product including a computer readable medium having recorded thereon a computer program for resolution conversion of digital data.
A filter function used in digital data resolution conversion is often called a convolution kernel, a filter kernel or just a kernel. When a kernel produces data that passes through original data points of a sampled signal, it is often called an interpolating kernel and when the interpolated data produced is not constrained to pass through the original data points it is often called an approximating kernel.
Prior art kernels for digital data resolution conversion include the nearest neighbour (NN), linear, quadratic and cubic kernels. Coefficient value versus pixel plots of these kernels are shown in FIGS. 1 to 4 respectively. The NN kernel is the simplest method of interpolation, simply interpolating the image with the pixel value that is spatially nearest to the required pixel value. This method works quite well when the scaling ratio is an integer multiple of the original data as it introduces no new values, ie. no new colours, and preserves sharp edges. However, at other ratios the NN kernel has the disadvantage of shifting edge locations which often produces visible distortions in the output image, especially in images containing text or fine line details. Linear interpolation on the other hand allows for the introduction of new grey levels (or colours) that are effectively used to position edges at sub-pixel locations. This has the advantage of reducing the effect of shifted edge locations, however sharp edges can now appear to be blurred. Quadratic and cubic interpolation provide steeper step responses and therefore less edge blurring, however, the steeper response results in an overshoot on either side of the edge. These overshoots can make the edges in natural images appear sharper, but on text, fine lines, or on other computer generated graphics these overshoots are clearly visible and detract from the perceived image quality and text legibility. Step responses of these four kernels are shown in FIGS. 5 to 8.
A digital data resolution conversion method is known in which the parameters of a cubic kernel are adjusted so as to remove the overshoot in a step response using a two parameter Catmul-Rom cubic that has a kernel h(s) of the form:                               h          ⁡                      (            s            )                          =                  {                      xe2x80x83                    ⁢                                                                                                                                        (                                                  2                          -                                                                                    3                              2                                                        ⁢                                                          xe2x80x83                                                        ⁢                            b                                                    -                          c                                                )                                            ⁢                                              xe2x80x83                                            ⁢                                                                        "LeftBracketingBar"                          s                          "RightBracketingBar"                                                3                                                              +                                                                  (                                                                              -                            3                                                    +                                                      2                            ⁢                            b                                                    +                          c                                                )                                            ⁢                                              xe2x80x83                                            ⁢                                                                        "LeftBracketingBar"                          s                          "RightBracketingBar"                                                2                                                              +                                          (                                              1                        -                                                                              1                            3                                                    ⁢                          b                                                                    )                                                        ,                                                            "LeftBracketingBar"                      s                      "RightBracketingBar"                                        ≤                    1                                                                                                                                                                                          (                                                                                                            1                              6                                                        ⁢                                                          xe2x80x83                                                        ⁢                            b                                                    -                          c                                                )                                            ⁢                                              xe2x80x83                                            ⁢                                                                        "LeftBracketingBar"                          s                          "RightBracketingBar"                                                3                                                              +                                                                  (                                                  b                          +                                                      5                            ⁢                            c                                                                          )                                            ⁢                                              xe2x80x83                                            ⁢                                                                        "LeftBracketingBar"                          s                          "RightBracketingBar"                                                2                                                              +                                                                  (                                                                                                            -                              2                                                        ⁢                            b                                                    -                                                      8                            ⁢                            c                                                                          )                                            ⁢                                              xe2x80x83                                            ⁢                                              "LeftBracketingBar"                        s                        "RightBracketingBar"                                                              +                                          (                                                                                                    4                            3                                                    ⁢                          b                                                +                                                  4                          ⁢                          c                                                                    )                                                        ,                                      1                     less than                                           "LeftBracketingBar"                      s                      "RightBracketingBar"                                        ≤                    2                                                                                                                        0                  ,                                      xe2x80x83                                    ⁢                  Otherwise                                                              ⁢                      xe2x80x83                                              (1)            
where s=t/xcex94t, the parameter b is fixed at b=0, whilst c is varied between 0, 0.5, and 1 dependent upon the edge strength (ie: the sharpness of the edge) measured using a Laplacian of Gaussian (LOG) edge detector. At a sharp edge c=0 and the resulting cubic is:                               h          ⁡                      (            s            )                          =                  {                      xe2x80x83                    ⁢                                                                                                                2                      ⁢                                                                        "LeftBracketingBar"                          s                          "RightBracketingBar"                                                3                                                              -                                          3                      ⁢                                                                        "LeftBracketingBar"                          s                          "RightBracketingBar"                                                2                                                              +                    1                                    ,                                                            "LeftBracketingBar"                      s                      "RightBracketingBar"                                        ≤                    1                                                                                                                        0                  ,                                      xe2x80x83                                    ⁢                  Otherwise                                                              ⁢                      xe2x80x83                                              (2)            
There is however, a problem with using this kernel to interpolate image data when the resampled pixel displacement is not significantly different from the original pixel displacement, say a re-sampling ratio of 10/11 or 11/10. In this case, pixels at the edges of text and other fine lines take on a grey value rather than the original black or white image values. This again results in a perceived blurring of sharp edges and a reduction in the observed image quality.
It is an object of the present invention to ameliorate one or more disadvantages of the prior art.
According to one aspect of the invention there is provided a method of providing a representation of image data, the method comprising the following steps:
(i) accessing a plurality of discrete sample values of said image data;
(ii) calculating kernel values for each of said discrete sample values using a scaled kernel, wherein said scaled kernel is constructed by transforming a kernel from a first range to a second range, and wherein said second range is less than said first range, wherein kernel values can be calculated over the said entire first range; and
(iii) convolving said kernel values with said discrete sample values to provide a representation of said image data.
According to another aspect of the invention there is provided an apparatus for providing a representation of image data, the apparatus comprising:
accessing means for accessing a plurality of discrete sample values of said image data;
calculating means for calculating kernel values for each of said discrete sample values using a scaled kernel, wherein said scaled kernel is constructed by transforming a kernel from a first range to a second range, and wherein said second range is less than said first range, wherein kernel values can be calculated over the said entire first range; and
convolving means for convolving said kernel values with said discrete sample values to provide a representation of said image data.
According to a still further aspect of the present invention there is provided a computer readable medium for storing a program for an apparatus which processes data, said processing comprising a method of providing a representation of image data, said program comprising:
code for accessing a plurality of discrete sample values of said image data;
code for calculating kernel values for each of said discrete sample values using a scaled kernel, wherein said scaled kernel is constructed by transforming a kernel from a first range to a second range, and wherein said second range is less than said first range, wherein kernel values can be calculated over the said entire first range; and
code for convolving said kernel values with said discrete sample values to provide a representation of said image data.
According to a still further aspect of the present invention there is provided a method of representing image data, the method comprising the following steps:
(i) accessing a plurality of discrete sample values of said image data;
(ii) calculating kernel values for each of said discrete sample values using a scaled kernel, wherein said scaled kernel is of the form:       h    ⁡          (      s      )        =      {                                                      1              -              d                         less than             s            ≤            d                                                xe2x80x83                                                            0            ,                                          -                                  (                                      1                    -                    d                                    )                                            ≥              s               greater than                               (                                  1                  -                  d                                )                                                                          xe2x80x83                                                                                          2                ⁢                                                      "LeftBracketingBar"                                                                  s                        -                        d                                                                    1                        -                                                  2                          ⁢                          d                                                                                      "RightBracketingBar"                                    3                                            -                              3                ⁢                                                      "LeftBracketingBar"                                                                  s                        -                        d                                                                    1                        -                                                  2                          ⁢                          d                                                                                      "RightBracketingBar"                                    2                                            +              1                        ,                          xe2x80x83                        ⁢            otherwise                                                xe2x80x83                              
xe2x80x83and wherein s=t/xcex94t and 0xe2x89xa6d less than 0.5; and
(iii) convolving said kernel values with said discrete sample values to provide a representation of said image data.
According to a still further aspect of the present invention there is provided an apparatus for representing image data, the apparatus comprising:
accessing means for accessing a plurality of discrete sample values of said image data;
calculating means for calculating kernel values for each of said discrete sample values using a scaled kernel, wherein said scaled kernel is of the form:       h    ⁡          (      s      )        =      {                                                      1              -              d                         less than             s            ≤            d                                                xe2x80x83                                                            0            ,                                          -                                  (                                      1                    -                    d                                    )                                            ≥              s               greater than                               (                                  1                  -                  d                                )                                                                          xe2x80x83                                                                                          2                ⁢                                                      "LeftBracketingBar"                                                                  s                        -                        d                                                                    1                        -                                                  2                          ⁢                          d                                                                                      "RightBracketingBar"                                    3                                            -                              3                ⁢                                                      "LeftBracketingBar"                                                                  s                        -                        d                                                                    1                        -                                                  2                          ⁢                          d                                                                                      "RightBracketingBar"                                    2                                            +              1                        ,                          xe2x80x83                        ⁢            otherwise                                                xe2x80x83                              
xe2x80x83and wherein s=t/xcex94t and 0xe2x89xa6d less than 0.5; and
convolving means for convolving said kernel values with said discrete sample values to provide a representation of said image data.
According to a still further aspect of the present invention there is provided a computer readable medium for storing a program for an apparatus which processes data, said processing comprising a method of representing image data, said program comprising:
code for accessing a plurality of discrete sample values of said image data;
code for calculating kernel values for each of said discrete sample values using a scaled kernel, wherein said scaled kernel is of the form:       h    ⁡          (      s      )        =      {                                        1            ,                                                              -              d                         less than             s            ≤            d                                                            0            ,                                                              -                              (                                  1                  -                  d                                )                                      ≥            s             greater than                           (                              1                -                d                            )                                                                                                      2                ⁢                                                      "LeftBracketingBar"                                                                  s                        -                        d                                                                    1                        -                                                  2                          ⁢                          d                                                                                      "RightBracketingBar"                                    3                                            -                              3                ⁢                                                      "LeftBracketingBar"                                                                  s                        -                        d                                                                    1                        -                                                  2                          ⁢                          d                                                                                      "RightBracketingBar"                                    2                                            +              1                        ,                                    otherwise                    
xe2x80x83otherwise and wherein s=t/xcex94t and 0xe2x89xa6d less than 0.5; and
code for convolving said kernel values with said discrete sample values to provide a representation of said image data.
According to a still further aspect of the present invention there is provided a method of transforming a kernel for image processing the method comprising the following steps:
(i) accessing a kernel for image processing;
(ii) transforming said kernel from a first range to a second range, wherein said second range is less than said first range; and
(iii) storing said transformed kernel.
According to a still further aspect of the present invention there is provided an apparatus for transforming a kernel for image processing, said apparatus comprising:
accessing means for accessing a kernel for image processing;
transforming means for transforming said kernel from a first range to a second range, wherein said second range is less than said first range; and
storing means for storing said transformed kernel.
According to a still further aspect of the present invention there is provided a computer readable medium for storing a program for an apparatus which processes data, said processing comprising a method of transforming a kernel for image processing, said program comprising:
code for accessing a kernel for image processing;
code for transforming said kernel from a first range to a second range, wherein said second range is less than said first range; and
code for storing said transformed kernel.
According to a still further aspect of the present invention there is provided a method of converting a first set of discrete data sample values of an image having a first sample rate to a second set of discrete data sample values of said image having a second sample rate, the method comprising the following steps:
(i) accessing said first set of data sample values; and
(ii) performing the following operations for each data value of said second set;
(a) calculating kernel values for each of said discrete sample values of said first set, according to a first kernel, wherein said first kernel is constructed from a scaled version of a second kernel; and
(b) convolving said kernel values with said discrete sample values of said first data set to provide a current data value of said second set.
According to a still further aspect of the present invention there is provided an apparatus for converting a first set of discrete data sample values of an image having a first sample rate to a second set of discrete data sample values of said image having a second sample rate, the apparatus comprising:
access means for accessing said first set of data sample values; and
processing means for performing the following operations for each data value of said second set;
(a) calculating kernel values for each of said discrete sample values of said first set, according to a first kernel, wherein said first kernel is constructed from a scaled version of a second kernel; and
(b) convolving said kernel values with said discrete sample values of said first data set to provide a current data value of said second set.
According to a still further aspect of the present invention there is provided a computer readable medium for storing a program for an apparatus which processes data, said processing comprising a method of converting a first set of discrete data sample values of an image having a first sample rate to a second set of discrete data sample values of said image having a second sample rate, said program comprising:
code for accessing said first set of data sample values; and
code for performing the following operations for each data value of said second set;
(a) calculating kernel values for each of said discrete sample values of said first set, according to a first kernel, wherein said first kernel is constructed from a scaled version of a second kernel; and
(b) convolving said kernel values with said discrete sample values of said first data set to provide a current data value of said second set.